﻿#include "MyWindow.h"
#include <QtWidgets/QApplication>
#include <QLocale>
#include <QTranslator>
//#include <QDir>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    //QDir::setCurrent("C:/Valid/Directory/Path");

    QTranslator translator;
    const QStringList uiLanguages = QLocale::system().uiLanguages();
    for (const QString& locale : uiLanguages) {
        const QString baseName = "Qt_MyMusic_" + QLocale(locale).name();
        if (translator.load(":/i18n/" + baseName)) {
            a.installTranslator(&translator);
            break;
        }
    }

    MyWindow w;
    // 设置窗口标题
    w.setWindowTitle("SCY 测试");
    w.show();
    return a.exec();
}
